package cn.yhbk.web.modules.manager.Mapper;

import cn.yhbk.web.modules.manager.Pojo.DTO.Class.ClassParam;
import cn.yhbk.web.modules.manager.Pojo.DTO.Class.TbClassDto;
import cn.yhbk.web.modules.manager.Pojo.Entity.TbClass;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 班级表 Mapper 接口
 * </p>
 *
 * @author 有何不可
 * @since 2023-08-05
 */
@Mapper
@Repository
public interface TbClassMapper extends BaseMapper<TbClass> {

    TbClassDto queryClassById(Long id);

    Boolean insertClass(TbClass tbClass);

    Boolean updateClassById(TbClass tbClass);

    Boolean deleteClassById(Long id);

    Integer queryTotalNum(Long collegeId);

    List<TbClassDto> queryClassPage(@Param("i") Integer i,
                                    @Param("pageSize") Integer pageSize,
                                    @Param("collegeId") Long collegeId);

    List<ClassParam> getClassAll();

    boolean operatePopulation(@Param("num") int num, @Param("classId") Long classId);
}
